#pragma once

#include "Object.h"
#include "CountdownTimer.h"

class CWeapon
	: public Object
{
public:
	enum WEAPON
	{
		DUALSWORD = 0,
		LONGSWORD,
		SWORDANDSHIELD,

		TOTAL,
	};

protected:
	// Sprite
	int					sprite_anim_start,
						sprite_anim_end;

	// Animation
	int					animation_interval;
	bool				animation_play;

	// Stats
	int					stats_level,
						stats_attackinterval;

	float				stats_damage,
						stats_damage_do,
						stats_damage_modifier;

	// Weapon
	CWeapon::WEAPON		type_id;

	// Timer
	CCountdownTimer		timer_attackdelay;

public:
	// Constructor
	CWeapon(void);
	// Destructor
	~CWeapon(void);

	// Set Sprite Animation Interval
	void	SetSpriteAnimationInterval	(const int animation_interval);

	// Set Level
	void	SetLevel					(const int level);

	// Set Attack Damage
	void	SetAttackDamage				(const float attack_damage);

	// Set Attack Damage Modifier
	void	SetAttackDamageModifier		(const float attack_damage_modifier);

	// Set Attack Speed
	void	SetAttackSpeed				(const int attack_speed);

	// Get Sprite Animation Start Image Number
	int		GetSpriteAnimationStart		(void);

	// Get Sprite Animation End Image Number
	int		GetSpriteAnimationEnd		(void);

	// Get Sprite Animation Interval
	int		GetSpriteAnimationInterval	(void);

	// Get Sprite Animation Play
	bool	GetSpriteAnimationPlay		(void);

	// Get Level
	int		GetLevel					(void);

	// Get Attack Damage
	float	GetAttackDamage				(void);

	// Get Attack Damage Attack
	float	GetAttackDamageAttack		(void);

	// Get Attack Damage Modifier
	float	GetAttackDamageModifier		(void);

	// Get Attack Speed
	int		GetAttackSpeed				(void);

	// Get Weapon Type ID
	CWeapon::WEAPON	GetWeaponTypeID		(void);

	// Check If Attacking
	bool	CheckIfAttacking			(void);

	// Check Whether Attack Delay Timer Has Ended
	bool	CheckAttackDelayEnd			(void);

	// Weapon Level Up
	virtual void DoLevelUpWeapon		(const int how_many_level = 1);

	// Reset Weapon
	void	ResetWeapon					(void);

	// Attack Interval End
	void	AttackEndInterval			(void);

	// Attack End
	void	AttackEnd					(void);

	// Primary Attack
	virtual void AttackPrimaryAttack	(void);

	// Secondary Attack
	virtual void AttackSecondaryAttack	(void);

	// Initialise
	virtual void Initialise				(const int SIZE_X = 50, const int SIZE_Y = 50, const int animation_interval = 1000, const int level = 1, const float attack_damage = 1.0f, const float attack_damage_modifier = 1.0f, const int attack_speed = 1000);
	
	// Update Object
	virtual void UpdateObject			(float elapsed);

	// Render Object
	virtual void RenderObject			(void);
};